function new_struct = load_struct(field_name, default_value);

% load_struct - load a structure up with the field_names and their corresponding
% default_values

if (nargin ~= 2)
   return
elseif (~iscell(field_name))
   disp('load_struct: field_name must be cell array');
   return
elseif (~iscell(default_value))
   return
   disp('load_struct: default_value must be cell array');
end

% determine number of fields
% check field names are strings

num_field = min(length(field_name), length(default_value));
for i = 1 : num_field
   if (~ischar(field_name{i}))
      return
   end
end


% create field with default value
new_struct=[]; % start with an empty structure

for i = 1 : num_field
   if (~isfield(new_struct, field_name{i})) % prevents DUPLICATES...
      new_struct = setfield(new_struct, field_name{i}, default_value{i});
   end
end
return
